package ui;

import java.awt.EventQueue;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;

import java.awt.BorderLayout;

import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.border.MatteBorder;

import java.awt.FlowLayout;
import java.util.ArrayList;

import control.*;
import model.*;

import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;

import javax.swing.BoxLayout;

import db.DBApartment;

public class UI2ndSem {

	//private CtrApartment aCtr;
	
	private JFrame frame;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					UI2ndSem window = new UI2ndSem();
					window.frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public UI2ndSem() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		
//		final Component myComponent = makeTheFrameOrWhatever();
//		this.addComponentListener(new ComponentAdapter() {
//		    @Override
//		    public void componentResized(ComponentEvent e)
//		    {
//		        myComponent.repaint();
//		    }
//		});
		frame = new JFrame();

		frame.setBounds(100, 100, 694, 497);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
		frame.getContentPane().add(tabbedPane, BorderLayout.CENTER);
		
		//tabbedPane.addTab("Messages", null, new ItemList("Messages",100), null);
	
		tabbedPane.addTab("Messages", null, new MessagePanel("Messages",100), null);
		
		
		//JPanel calendarPanel = new JPanel();
		tabbedPane.addTab("Calendar", null, new CalendarPanel(), null);
		
		
		//calendarPanel.setLayout(new BoxLayout(calendarPanel, BoxLayout.X_AXIS));
		//calendarPanel.add(new CalendarPanel());
		//calendarPanel.add(new ItemList("Tasks",100));
		
		
		tabbedPane.addTab("Waiting List", null, new WaitinglistPanel("Waiting List",100), null);
		tabbedPane.addTab("Apartments", null, new ApartmentPanel("Apartments",100), null);
	}
	
}

	

		
